<?php
/**
 * XmuSlh, web platform of Student Association Federation of Xiamen University
 * 
 * Rewritting one or some pages of StatusNet. 
 * To get the original version, please visit <http://status.net/>.
 * 
 * StatusNet, the distributed open-source microblogging tool
 * 
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Show the ABOUT information.
 * 
 * @author		ytukie <ytukie@gmail.com>
 * @version		0.1
 */

// XmuSlh only.
if ( !defined('XMUSLH')) { exit(1); }

// Requirements.
require_once INSTALLDIR . '/lib/slh_action.php';
require_once INSTALLDIR . '/lib/slh_util.php';

class AboutAction extends Action
{
	/**
	 * Choice of the about information.
	 */
	var $choice;
	
	function title()
	{
		return '关于社联会';
	}
	
	function prepare($args)
	{
		parent::prepare($args);
		
		// Get the choice.
		$this->choice = $this->getTrimmedArg('gchoice');
		
		return true;
	}
	
	function handle($args)
	{
		parent::handle($args);
		
		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
			;
		} else {
			$this->showPage();
		}
	}
	
	/**
	 * Overriding the showInnerContent().
	 */
	function showInnerContent()
	{
		if (0 == strcmp($this->choice, 'department')) {
			$this->showDeparment();
		} else if (0 == strcmp($this->choice, 'contact')) {
			$this->showContact();
		} else if (0 == strcmp($this->choice, '7')) {
			$this->show7();
		} else if (0 == strcmp($this->choice, '8')) {
			$this->show8();
		} else {
			$this->showIntro();
		}
	}
	
	/**
	 * Overriding the showAsideContent().
	 */
	function showInnerAside()
	{
		$this->elementStart('div', array('id' => 'cls_div_asidenav'));
		
		$this->elementStart('dl');
		// The News options.
		$this->element('dt', null, '● 关于社联会');
		$this->elementStart('dd');
		$this->elementStart('ul');
			$this->elementStart('li');
			$this->element('a', array('href' => slh_action2url('about') . '?gchoice=intro'), 
								'社联会介绍');
			$this->elementEnd('li');
			
			$this->elementStart('li');
			$this->element('a', array('href' => slh_action2url('about') . '?gchoice=department'), 
								'组织部门');
			$this->elementEnd('li');
			
			$this->elementStart('li');
			$this->element('a', array('href' => slh_action2url('about') . '?gchoice=contact'), 
								'联系方式');
			$this->elementEnd('li');
			
			$this->elementStart('li');
			$this->element('a', array('href' => slh_action2url('about') . '?gchoice=7'), 
								'第七届委员');
			$this->elementEnd('li');
			
			$this->elementStart('li');
			$this->element('a', array('href' => slh_action2url('about') . '?gchoice=8'), 
								'第八届委员');
			$this->elementEnd('li');
		$this->elementEnd('ul');
		$this->elementEnd('dd');
		$this->elementEnd('dl');
		
		$this->elementEnd('div');
	}
	
	/**
	 * Show introduction.
	 */
	function showIntro()
	{
		$this->element('h3', null, '关于社联会');
		
		$part1 = file_get_contents(INSTALLDIR . '/plain/txt/intro_part1.txt');
		$part2 = file_get_contents(INSTALLDIR . '/plain/txt/intro_part2.txt');
		
		$this->elementStart('div', 'cls_div_text');
		$this->element('hr');
		$this->raw($part1);
		$this->element('hr');
		$this->raw($part2);
		$this->element('hr');
		$this->elementEnd('div');
	}
	
	/**
	 * Show contact way.
	 */
	function showContact()
	{
		$this->element('h3', null, '联系方式');
		
		$contact = file_get_contents(INSTALLDIR . '/plain/txt/contact.txt');
		
		$this->elementStart('div', 'cls_div_text');
		$this->element('hr');
		$this->raw($contact);
		$this->element('hr');
		$this->elementEnd('div');
	}
	
	/**
	 * Show deparments.
	 */
	function showDeparment()
	{
		$this->element('h3', null, '组织部门');
		
		$part1 = file_get_contents(INSTALLDIR . '/plain/txt/department_part1.txt');
		$part2 = file_get_contents(INSTALLDIR . '/plain/txt/department_part2.txt');
		$part3 = file_get_contents(INSTALLDIR . '/plain/txt/department_part3.txt');
		$part4 = file_get_contents(INSTALLDIR . '/plain/txt/department_part4.txt');
		$part5 = file_get_contents(INSTALLDIR . '/plain/txt/department_part5.txt');
		$part6 = file_get_contents(INSTALLDIR . '/plain/txt/department_part6.txt');
		$part7 = file_get_contents(INSTALLDIR . '/plain/txt/department_part7.txt');
		$part8 = file_get_contents(INSTALLDIR . '/plain/txt/department_part8.txt');
		$part9 = file_get_contents(INSTALLDIR . '/plain/txt/department_part9.txt');
		$part10 = file_get_contents(INSTALLDIR . '/plain/txt/department_part10.txt');
		$part11 = file_get_contents(INSTALLDIR . '/plain/txt/department_part11.txt');
		$part12 = file_get_contents(INSTALLDIR . '/plain/txt/department_part12.txt');
		
		$this->elementStart('div', 'cls_div_text');
		$this->element('hr');
		$this->element('h4', null, '主席团');
		$this->raw($part1);
		$this->element('hr');
		$this->element('h4', null, '社会实践类社团理事会');
		$this->raw($part2);
		$this->element('hr');
		$this->element('h4', null, '科技学术类社团理事会');
		$this->raw($part3);
		$this->element('hr');
		$this->element('h4', null, '文化艺术类社团理事会');
		$this->raw($part4);
		$this->element('hr');
		$this->element('h4', null, '体育健身类社团理事会');
		$this->raw($part5);
		$this->element('hr');
		$this->element('h4', null, '办公室');
		$this->raw($part6);
		$this->element('hr');
		$this->element('h4', null, '评议部');
		$this->raw($part7);
		$this->element('hr');
		$this->element('h4', null, '策划部');
		$this->raw($part8);
		$this->element('hr');
		$this->element('h4', null, '外联部');
		$this->raw($part9);
		$this->element('hr');
		$this->element('h4', null, '网络部');
		$this->raw($part10);
		$this->element('hr');
		$this->element('h4', null, '新闻中心');
		$this->raw($part11);
		$this->element('hr');
		$this->element('h4', null, '组织部');
		$this->raw($part12);
		$this->element('hr');
		$this->elementEnd('div');
	}
	
	/**
	 * Show 7th committee members.
	 */
	function show7()
	{
		$part1	= file_get_contents(INSTALLDIR . '/plain/txt/7_part1.txt');
		$part2	= file_get_contents(INSTALLDIR . '/plain/txt/7_part2.txt');
		$part3	= file_get_contents(INSTALLDIR . '/plain/txt/7_part3.txt');
		$part4	= file_get_contents(INSTALLDIR . '/plain/txt/7_part4.txt');
		$part5	= file_get_contents(INSTALLDIR . '/plain/txt/7_part5.txt');
		$part6	= file_get_contents(INSTALLDIR . '/plain/txt/7_part6.txt');
		$part7	= file_get_contents(INSTALLDIR . '/plain/txt/7_part7.txt');
		$part8	= file_get_contents(INSTALLDIR . '/plain/txt/7_part8.txt');
		$part9	= file_get_contents(INSTALLDIR . '/plain/txt/7_part9.txt');
		$part10	= file_get_contents(INSTALLDIR . '/plain/txt/7_part10.txt');
		$part11	= file_get_contents(INSTALLDIR . '/plain/txt/7_part11.txt');
		$part12	= file_get_contents(INSTALLDIR . '/plain/txt/7_part12.txt');
		$part13	= file_get_contents(INSTALLDIR . '/plain/txt/7_part13.txt');
		$part14	= file_get_contents(INSTALLDIR . '/plain/txt/7_part14.txt');
		$part15	= file_get_contents(INSTALLDIR . '/plain/txt/7_part15.txt');
		$part16	= file_get_contents(INSTALLDIR . '/plain/txt/7_part16.txt');
		$part17	= file_get_contents(INSTALLDIR . '/plain/txt/7_part17.txt');
		$part18	= file_get_contents(INSTALLDIR . '/plain/txt/7_part18.txt');
		
		$this->element('h3', null, '第七届委员');
		
		$this->elementStart('div', 'cls_div_text');
		$this->element('hr');
		$this->element('h4', null, '曹福超');
		$this->raw($part1);
		$this->element('hr');
		$this->element('h4', null, '欧阳长怡');
		$this->raw($part2);
		$this->element('hr');
		$this->element('h4', null, '王悦虹');
		$this->raw($part3);
		$this->element('hr');
		$this->element('h4', null, '芦小文龙');
		$this->raw($part4);
		$this->element('hr');
		$this->element('h4', null, '张灵炀');
		$this->raw($part5);
		$this->element('hr');
		$this->element('h4', null, '何妍');
		$this->raw($part6);
		$this->element('hr');
		$this->element('h4', null, '张少波');
		$this->raw($part7);
		$this->element('hr');
		$this->element('h4', null, '马艺文');
		$this->raw($part8);
		$this->element('hr');
		$this->element('h4', null, '郑丽');
		$this->raw($part9);
		$this->element('hr');
		$this->element('h4', null, '蒋炳彬');
		$this->raw($part10);
		$this->element('hr');
		$this->element('h4', null, '郭坤桥');
		$this->raw($part11);
		$this->element('hr');
		$this->element('h4', null, '孙蒙');
		$this->raw($part12);
		$this->element('hr');
		$this->element('h4', null, '杨尚明');
		$this->raw($part13);
		$this->element('hr');
		$this->element('h4', null, '陈国锋');
		$this->raw($part14);
		$this->element('hr');
		$this->element('h4', null, '黄丽娜');
		$this->raw($part15);
		$this->element('hr');
		$this->element('h4', null, '张晗梅');
		$this->raw($part16);
		$this->element('hr');
		$this->element('h4', null, '陈珊桦');
		$this->raw($part17);
		$this->element('hr');
		$this->element('h4', null, '王思敏');
		$this->raw($part18);
		$this->element('hr');
		$this->elementEnd('div');
	}
	
	/**
	 * Show 8th committee members.
	 */
	function show8()
	{
		$part1	= file_get_contents(INSTALLDIR . '/plain/txt/8_part1.txt');
		$part2	= file_get_contents(INSTALLDIR . '/plain/txt/8_part2.txt');
		$part3	= file_get_contents(INSTALLDIR . '/plain/txt/8_part3.txt');
		$part4	= file_get_contents(INSTALLDIR . '/plain/txt/8_part4.txt');
		$part5	= file_get_contents(INSTALLDIR . '/plain/txt/8_part5.txt');
		$part6	= file_get_contents(INSTALLDIR . '/plain/txt/8_part6.txt');
		$part7	= file_get_contents(INSTALLDIR . '/plain/txt/8_part7.txt');
		$part8	= file_get_contents(INSTALLDIR . '/plain/txt/8_part8.txt');
		$part9	= file_get_contents(INSTALLDIR . '/plain/txt/8_part9.txt');
		$part10	= file_get_contents(INSTALLDIR . '/plain/txt/8_part10.txt');
		$part11	= file_get_contents(INSTALLDIR . '/plain/txt/8_part11.txt');
		$part12	= file_get_contents(INSTALLDIR . '/plain/txt/8_part12.txt');
		$part13	= file_get_contents(INSTALLDIR . '/plain/txt/8_part13.txt');
		$part14	= file_get_contents(INSTALLDIR . '/plain/txt/8_part14.txt');
		$part15	= file_get_contents(INSTALLDIR . '/plain/txt/8_part15.txt');
		$part16	= file_get_contents(INSTALLDIR . '/plain/txt/8_part16.txt');
		$part17	= file_get_contents(INSTALLDIR . '/plain/txt/8_part17.txt');
		$part18	= file_get_contents(INSTALLDIR . '/plain/txt/8_part18.txt');
		
		$this->element('h3', null, '第八届委员');
		
		$this->elementStart('div', 'cls_div_text');
		$this->element('hr');
		$this->element('h4', null, '朱清风');
		$this->raw($part1);
		$this->element('hr');
		$this->element('h4', null, '梁爽');
		$this->raw($part2);
		$this->element('hr');
		$this->element('h4', null, '黄雪迪');
		$this->raw($part3);
		$this->element('hr');
		$this->element('h4', null, '陈婉颖');
		$this->raw($part4);
		$this->element('hr');
		$this->element('h4', null, '翁海伦');
		$this->raw($part5);
		$this->element('hr');
		$this->element('h4', null, '王洁');
		$this->raw($part6);
		$this->element('hr');
		$this->element('h4', null, '李玲');
		$this->raw($part7);
		$this->element('hr');
		$this->element('h4', null, '徐园园');
		$this->raw($part8);
		$this->element('hr');
		$this->element('h4', null, '程江霞');
		$this->raw($part9);
		$this->element('hr');
		$this->element('h4', null, '刘晓菲');
		$this->raw($part10);
		$this->element('hr');
		$this->element('h4', null, '张淼');
		$this->raw($part11);
		$this->element('hr');
		$this->element('h4', null, '袁淑君');
		$this->raw($part12);
		$this->element('hr');
		$this->element('h4', null, '董乐超');
		$this->raw($part13);
		$this->element('hr');
		$this->element('h4', null, '张瀚予');
		$this->raw($part14);
		$this->element('hr');
		$this->element('h4', null, '孙韵平');
		$this->raw($part15);
		$this->element('hr');
		$this->element('h4', null, '刘挺');
		$this->raw($part16);
		$this->element('hr');
		$this->element('h4', null, '潘婧');
		$this->raw($part17);
		$this->element('hr');
		$this->element('h4', null, '于亮');
		$this->raw($part18);
		$this->element('hr');
		$this->elementEnd('div');
	}
}

?>